package com.lagou.task08;

public class Dog extends  Animal {
    private int toothNum;

    public Dog(){

    }

    public Dog(String name, String color, int toothNum){
        setColor(color);
        setName(name);
        setToothNum(toothNum);
    }

    public void setToothNum(int toothNum) {
        if (toothNum <= 0){
            this.toothNum = toothNum;
        }else {
            System.out.println("牙齿数量不合理");
        }

    }

    public int getToothNum() {
        return toothNum;
    }

    public void show(){
        super.show();
        System.out.print(" have " + getToothNum() + " tooth");
    }
}
